package cn.sinjet.utils;

import android.app.AlertDialog;
import android.content.Context;
import cn.sinjet.model.carsystem.CarModel;

public class ShowDialogUtil {
	  Context mContext = null;
	  AlertDialog dialog = null;
	  String mTextPositive = "确定";
	  String mTextNegative = "取消";
      public ShowDialogUtil(){
      }
      
      public interface OnDialogAction{
    	  void onPositive();
    	  void onNegative();
      }
      
      public void setOnDialogActionListern(OnDialogAction onDialogAction){
    	  CarModel.getInstance().setOnDialogActionListener(onDialogAction);
      }
      
      public void setButtonText(String positiveText,String negativeText){
    	  mTextPositive = positiveText;
    	  mTextNegative = negativeText;
      }
      
      public void showDialog(String title,String content){
    	   CarModel.getInstance().showDialogAlertInUIThread(title, content, mTextNegative, mTextPositive);      		  
      }
      
      public void showToast(String content){
    	  CarModel.getInstance().showToastInUIThread(content);
      }
      
}
